﻿using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;

namespace TLCMap
{
    class Program
    {
        static void Main(string[] args)
        {
            SearchLearner(args[0], args[1]);
        }


        static void SearchLearner(String dllPath, String learnerName)
        {
            List<String> dlls = Directory.EnumerateFiles(dllPath, "*.dll").ToList();

            foreach (String dll in dlls)
            {
                try
                {
                    Assembly asm = Assembly.LoadFrom(dll);
                    Type[] types = asm.GetTypes();
                    foreach (var type in types)
                    {
                        if (type.Name.ToLower().Contains(learnerName.ToLower()))
                        {
                            Console.WriteLine(dll);
                            Console.WriteLine("\t{0}", type.Name);
                        }
                    }
                }
                catch
                {
                    //Console.WriteLine(ex.Message);
                }
            }
        }
    }
}
